//
//  LHBottomView.swift
//  sinaWeibo
//
//  Created by LiHong on 15/11/1.
//  Copyright © 2015年 LiHong. All rights reserved.
//

import UIKit

class LHBottomView: UIView {
    
    //MARK: - 构造函数
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        backgroundColor = UIColor.whiteColor()
        prepareUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    //MARK: - 准备UI
    private func prepareUI() {
        addSubview(retweetButton)
        addSubview(commentButton)
        addSubview(likeButton)
        addSubview(lineView1)
        addSubview(lineView2)
        
        //约束
        self.ff_HorizontalTile([retweetButton,commentButton,likeButton], insets: UIEdgeInsetsZero)
        
        //分隔线1
        lineView1.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: retweetButton, size: nil)
        //分隔线2
        lineView2.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButton, size: nil)
    }

    //MARK: - 懒加载
    ///转发
    private lazy var retweetButton: UIButton = UIButton(imageName: "timeline_icon_retweet", title: "转发")
    
    ///评论
    private lazy var commentButton: UIButton = UIButton(imageName: "timeline_icon_comment", title: "评论")
    
    ///点赞
    private lazy var likeButton: UIButton = UIButton(imageName: "timeline_icon_unlike", title: "点赞")
    
    ///水平分割线1
    private lazy var lineView1: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    
    ///水平分割线2
    private lazy var lineView2: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
}
